package com.mzj.saas.jobs.backlog.executor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.mzj.saas.jobs.backlog.service.BacklogService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;

/**
 * 待办事项-合同提醒
 * @author shun
 * @createDate: 2021年7月12日 下午3:13:19
 * @version: 1.0
 *
 */
@JobHandler(value = "backlogExecutor")
@Component
public class BacklogExecutor extends IJobHandler {
    private static Logger log = LoggerFactory.getLogger(BacklogExecutor.class);

    @Autowired
    private BacklogService backlogService;
    @Override
    public ReturnT<String> execute(String arg0) throws Exception {
        long time = System.currentTimeMillis();

        String result = backlogService.work();

        long useTime = System.currentTimeMillis() - time;
        log.info("----> backlogExecutor end, result: {}, use time: {}", result, useTime);

        return SUCCESS;
    }
}
